import request from '@/utils/request'

// 查询组织信息列表
export function listOrg(query) {
  return request({
    url: '/committee/orgCourse/page',
    method: 'get',
    params: query
  })
}

// 查询组织信息详细
export function getOrg(orgId) {
  return request({
    url: '/committee/org/' + orgId,
    method: 'get'
  })
}

// 新增组织信息
export function addOrg(data) {
  return request({
    url: '/committee/org',
    method: 'post',
    data: data
  })
}
export function addClass(data) {
  return request({
    url: '/committee/orgCourse/classSchedule',
    method: 'post',
    data: data
  })
}
// 新增组织信息
export function addOrgList(data) {
  return request({
    url: '/committee/orgCourse',
    method: 'post',
    data: data
  })
}
// 设置课程表
export function upClass(data) {
  return request({
    url: '/committee/type/default',
    method: 'post',
    data: data
  })
}
// 显示二维码
export function showQrCode(id) {
  return request({
    url: '/committee/orgCourse/createQrCode?id=' + id,
    method: 'get',
  })
}

//下载图片
export function downloadImgs(params) {
  return request({
    url: '/common/download/url',//后端自定义的下载接口/common/download/url，路径为admin模块的com.ruoyi.web.controller.common;
    responseType: 'blob', //设置后端返回类型为二进制流，不设置会返回乱码
    method: 'get',
    params
  })
}
// 修改组织信息
export function updateOrg(data) {
  return request({
    url: '/committee/org',
    method: 'put',
    data: data
  })
}

// 删除列表
export function delOrg(id) {
  return request({
    url: '/committee/orgCourse/' + id,
    method: 'delete'
  })
}
export const GetActivityDetail = id =>
  request({
    url: `/committee/orgCourse/${id}`,
    method: 'get',
    // params: { id },
  });

// 全部参与列表
export const GetMemberDetail = data =>
  request({
    url: '/committee/orgCourseStudent/list2',
    method: 'get',
    params: data,
  });

// 材料列表
export const Getmaterials = data =>
  request({
    url: '/committee/orgCourse/selectProfile',
    method: 'get',
    params: data,
  });
// 新增材料
export const addFile = data =>
  request({
    url: '/committee/orgCourse/insertProfile',
    method: 'post',
    data: data,
  });

// 待签到签退
export const sign = id =>
  request({
    url: '/committee/orgCourseStudent/signIn/' + id,
    method: 'get',
  });


// 学生管理员下拉框
export function getstudentmanager(parm) {
  return request({
    url: '/committee/org/getstudentmanager/' + parm,
    method: 'get'
  })
}
// 教师管理员下拉框
export function getTeacherManager(parm) {
  return request({
    url: '/committee/org/getTeacherManager/' + parm,
    method: 'get'
  })
}
// 设置学生管理员
export function setstudentmanager(data) {
  return request({
    url: '/committee/org/setstudentmanager',
    method: 'put',
    data: data
  })
}
export function timeList(query) {
  return request({
    url: '/committee/type/list',
    method: 'get',
    params: query
  })
}
export function actAct(query) {
  return request({
    url: '/committee/orgCourse/sync',
    method: 'get',
  })
}
export function getClass(query) {
  return request({
    url: '/committee/orgCourse/selectOrgClubTypeList',
    method: 'get',
  })
}
export function actAct1(query) {
  return request({
    url: '/committee/orgCourse/syncStudent',
    method: 'get',
    params: query
  })
}

// 设置教师管理员
export function setteachermanager(data) {
  return request({
    url: '/committee/org/setteachermanager',
    method: 'put',
    data: data
  })
}

// 设置当前学期
export function editDefaultSchoolYear(data) {
  return request({
    url: '/committee/year/editDefaultSchoolYear',
    method: 'put',
    data: data
  })
}